<script setup>
import { inject } from 'vue'

// 接收祖先组件传递的值
const name = inject('myname')


const user = inject('user')
</script>
<template>
    <h1>子组件 -- {{ name }} -- {{ user }}</h1>
</template>